package com.yicong.ants.bean.circle;

import android.widget.TextView;

import com.cchao.simplelib.core.UiHelper;
import com.yicong.ants.R;

import java.util.List;

/**
 * @author cch
 * @version 2020/11/3
 */
public class JournalItem {


    /**
     * office_id : 20
     * type : 1
     * title : 覅我见过改哈今晚hiOA我们好卡文件hiOA尬舞哈维
     * author : 尬舞个
     * is_top : 0
     * tags : 0
     * urls_files : ["http://ant.qiniu.yblylm.com/uploads/20200928/daaa4cbd596a99167bf9ff71c1a4250e.jpeg"]
     * browse_qty : 557
     * share_qty : 638
     * like_qty : 5635
     * create_time : 11月03日 17时12分
     */

    private String id;
    private int type;
    private String content;
    private String nickname;
    private String avatar;
    private String poi;
    private String link;
    private int is_like;
    private int like_drawable;
    private int share_qty;
    private int like_qty;
    private int status;
    private String share_link;
    private String status_text;
    private String create_time;
    private List<String> resource;
    private String cover_img;

    public JournalItem() {
    }

    public int getLike_drawable() {
        return is_like == 1 ? R.drawable.journal_like_ed : R.drawable.journal_like_normal;
    }

    public void update_text(TextView textView) {
        textView.setText("赞 " + like_qty);
        textView.setCompoundDrawablesWithIntrinsicBounds(UiHelper.getDrawable(getLike_drawable()), null, null, null);
        if (is_like == 1) {
            textView.setTextColor(UiHelper.getColor(R.color.red_dark_primary));
        } else {
            textView.setTextColor(UiHelper.getColor(R.color.text_888));
        }
    }

    public String getId() {
        return this.id;
    }

    public int getType() {
        return this.type;
    }

    public String getContent() {
        return this.content;
    }

    public String getNickname() {
        return this.nickname;
    }

    public String getAvatar() {
        return this.avatar;
    }

    public String getPoi() {
        return this.poi;
    }

    public String getLink() {
        return this.link;
    }

    public int getIs_like() {
        return this.is_like;
    }

    public int getShare_qty() {
        return this.share_qty;
    }

    public int getLike_qty() {
        return this.like_qty;
    }

    public int getStatus() {
        return this.status;
    }

    public String getShare_link() {
        return this.share_link;
    }

    public String getStatus_text() {
        return this.status_text;
    }

    public String getCreate_time() {
        return this.create_time;
    }

    public List<String> getResource() {
        return this.resource;
    }

    public String getCover_img() {
        return this.cover_img;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setType(int type) {
        this.type = type;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public void setPoi(String poi) {
        this.poi = poi;
    }

    public void setLink(String link) {
        this.link = link;
    }

    public void setIs_like(int is_like) {
        this.is_like = is_like;
    }

    public void setLike_drawable(int like_drawable) {
        this.like_drawable = like_drawable;
    }

    public void setShare_qty(int share_qty) {
        this.share_qty = share_qty;
    }

    public void setLike_qty(int like_qty) {
        this.like_qty = like_qty;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public void setShare_link(String share_link) {
        this.share_link = share_link;
    }

    public void setStatus_text(String status_text) {
        this.status_text = status_text;
    }

    public void setCreate_time(String create_time) {
        this.create_time = create_time;
    }

    public void setResource(List<String> resource) {
        this.resource = resource;
    }

    public void setCover_img(String cover_img) {
        this.cover_img = cover_img;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof JournalItem)) return false;
        final JournalItem other = (JournalItem) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        if (this.getType() != other.getType()) return false;
        final Object this$content = this.getContent();
        final Object other$content = other.getContent();
        if (this$content == null ? other$content != null : !this$content.equals(other$content))
            return false;
        final Object this$nickname = this.getNickname();
        final Object other$nickname = other.getNickname();
        if (this$nickname == null ? other$nickname != null : !this$nickname.equals(other$nickname))
            return false;
        final Object this$avatar = this.getAvatar();
        final Object other$avatar = other.getAvatar();
        if (this$avatar == null ? other$avatar != null : !this$avatar.equals(other$avatar))
            return false;
        final Object this$poi = this.getPoi();
        final Object other$poi = other.getPoi();
        if (this$poi == null ? other$poi != null : !this$poi.equals(other$poi)) return false;
        final Object this$link = this.getLink();
        final Object other$link = other.getLink();
        if (this$link == null ? other$link != null : !this$link.equals(other$link)) return false;
        if (this.getIs_like() != other.getIs_like()) return false;
        if (this.getLike_drawable() != other.getLike_drawable()) return false;
        if (this.getShare_qty() != other.getShare_qty()) return false;
        if (this.getLike_qty() != other.getLike_qty()) return false;
        if (this.getStatus() != other.getStatus()) return false;
        final Object this$share_link = this.getShare_link();
        final Object other$share_link = other.getShare_link();
        if (this$share_link == null ? other$share_link != null : !this$share_link.equals(other$share_link))
            return false;
        final Object this$status_text = this.getStatus_text();
        final Object other$status_text = other.getStatus_text();
        if (this$status_text == null ? other$status_text != null : !this$status_text.equals(other$status_text))
            return false;
        final Object this$create_time = this.getCreate_time();
        final Object other$create_time = other.getCreate_time();
        if (this$create_time == null ? other$create_time != null : !this$create_time.equals(other$create_time))
            return false;
        final Object this$resource = this.getResource();
        final Object other$resource = other.getResource();
        if (this$resource == null ? other$resource != null : !this$resource.equals(other$resource))
            return false;
        final Object this$cover_img = this.getCover_img();
        final Object other$cover_img = other.getCover_img();
        if (this$cover_img == null ? other$cover_img != null : !this$cover_img.equals(other$cover_img))
            return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof JournalItem;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        result = result * PRIME + this.getType();
        final Object $content = this.getContent();
        result = result * PRIME + ($content == null ? 43 : $content.hashCode());
        final Object $nickname = this.getNickname();
        result = result * PRIME + ($nickname == null ? 43 : $nickname.hashCode());
        final Object $avatar = this.getAvatar();
        result = result * PRIME + ($avatar == null ? 43 : $avatar.hashCode());
        final Object $poi = this.getPoi();
        result = result * PRIME + ($poi == null ? 43 : $poi.hashCode());
        final Object $link = this.getLink();
        result = result * PRIME + ($link == null ? 43 : $link.hashCode());
        result = result * PRIME + this.getIs_like();
        result = result * PRIME + this.getLike_drawable();
        result = result * PRIME + this.getShare_qty();
        result = result * PRIME + this.getLike_qty();
        result = result * PRIME + this.getStatus();
        final Object $share_link = this.getShare_link();
        result = result * PRIME + ($share_link == null ? 43 : $share_link.hashCode());
        final Object $status_text = this.getStatus_text();
        result = result * PRIME + ($status_text == null ? 43 : $status_text.hashCode());
        final Object $create_time = this.getCreate_time();
        result = result * PRIME + ($create_time == null ? 43 : $create_time.hashCode());
        final Object $resource = this.getResource();
        result = result * PRIME + ($resource == null ? 43 : $resource.hashCode());
        final Object $cover_img = this.getCover_img();
        result = result * PRIME + ($cover_img == null ? 43 : $cover_img.hashCode());
        return result;
    }

    public String toString() {
        return "JournalItem(id=" + this.getId() + ", type=" + this.getType() + ", content=" + this.getContent() + ", nickname=" + this.getNickname() + ", avatar=" + this.getAvatar() + ", poi=" + this.getPoi() + ", link=" + this.getLink() + ", is_like=" + this.getIs_like() + ", like_drawable=" + this.getLike_drawable() + ", share_qty=" + this.getShare_qty() + ", like_qty=" + this.getLike_qty() + ", status=" + this.getStatus() + ", share_link=" + this.getShare_link() + ", status_text=" + this.getStatus_text() + ", create_time=" + this.getCreate_time() + ", resource=" + this.getResource() + ", cover_img=" + this.getCover_img() + ")";
    }
}
